From 347328adb09ff21f36ccf7608b253ba841742f9e Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Tue, 14 Feb 2012 17:26:03 +0200 Subject: [PATCH] GtkNotebook: emit child-notify::position on drag 'n drop reorder https://bugzilla.gnome.org/show_bug.cgi?id=669116 --- gtk/gtknotebook.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index bd5a3c1756..8f9221135e 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3185,7 +3185,7 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook) { if (priv->during_reorder) { - gint old_page_num, page_num; + gint old_page_num, page_num, i; GList *element; element = get_drop_position (notebook); @@ -3194,9 +3194,16 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook) gtk_notebook_child_reordered (notebook, page); if (priv->has_scrolled || old_page_num != page_num) - g_signal_emit (notebook, - notebook_signals[PAGE_REORDERED], 0, - page->child, page_num); + { + for (element = priv->children, i = 0; element; element = element->next) + { + if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num)) + gtk_widget_child_notify (((GtkNotebookPage *) element->data)->child, "position"); + } + g_signal_emit (notebook, + notebook_signals[PAGE_REORDERED], 0, + page->child, page_num); + } priv->has_scrolled = FALSE; priv->during_reorder = FALSE; -- 2.30.2